<?php
namespace App\Common\Cla\Com\Tool;

use App\Common as com;

class Server extends com\Cla\ClaBase {

	/**
	 * 取服务器代号
	 * @return string 服务器代号，未知则返回“unknown_server”
	 */
	public static function getNameSid():string {
		$computer_name_array = [
			// 'izwz95v28cjpudcri0dm14z' => clac\Server\Code::$serverNameSid_Server1,
		];
		$computer_name = self::getComputerName();
		return $computer_name_array[ $computer_name ] ?? 'server_unknown';
	}

	/**
	 * 取主机名
	 * @return string 主机名
	 */
	public static function getComputerName():string {
		return php_uname( 'n' );
	}

}
